import React, { Component } from 'react'

export default class App extends Component {
  state = {
    myname: '你好'
  }
  componentWillMount() {
    //TODO:改变state状态
    this.setState({
      myname:'张三'
    })
    console.log('componentWillMount111',this.state.myname)
  }
  componentDidMount(){
    //TODO:api请求 dom操作
    console.log('componentDidMount333',document.getElementById('myname'))
  }
  render() {
    console.log('render222')
    return (
      <div>
        <span id="myname">{this.state.myname}</span>
      </div>
    )
  }
}
